<template>
  <div>
    <div class="dashboard-container">dashboard</div>
    <button v-permission="['ROLE_SUPERADMIN']">按钮</button>
  </div>
</template>

<script>
import permission from "@/directive/permission/index.js"; // 权限判断指令
import { mapGetters } from "vuex";

export default {
  directives: { permission },
  name: "Dashboard",
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["roles"]),
  },
  created() {
    if (!this.roles.includes("admin")) {
      this.currentRole = "editorDashboard";
    }
  },
};
</script>
